package top.fzqblog.kotlinapp.app

import android.app.Application
import android.content.Context
import android.support.multidex.MultiDex

/**
 * 注册在manifest中
 * Created by 抽离 on 2017/11/7 0007.
 */
class KotlinApp:Application(){

    companion object{
//      用了notNull必须是var所以其他地方可变 不太好
//        var kotlinApp: KotlinApp by Delegates.notNull()

        private var kotlinApp: KotlinApp? = null

        public val instance: KotlinApp by lazy {
            kotlinApp !!
        }
    }

    override fun onCreate() {
        super.onCreate()
        kotlinApp = this
    }

    /**
     * 多dex
     */
    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        MultiDex.install(this)
    }

}

fun sayHello(){
    println("hello：")
}